// ##
#include "Timer.h"
// ## C++
#include <sstream>

namespace jm4bbx {

	void Timer::start() {
		time_ = ulibpp::system_info::get_relative_time();
	}


	void Timer::report(std::ostream& reportStram) {

		if (time_ == 0) start();

		ulibpp::uUINT64 actualTtime =
			ulibpp::system_info::get_relative_time();

		std::stringstream stream;
		stream << __FUNCTION__ << " " << (actualTtime - time_) << std::endl;
		reportStram << stream.str();
	}

	Timer* Timer::getInstance() {
		static Timer instance;
		return &instance;
	}

} // namespace jm4bbx
